package com.avengers.core.bean.enums;

/**
 * @author yu.wang
 * @since 2019/3/13 10:11 AM
 **/
public enum SymbolEnum {
    // 符号
    space(" ", "&nbsp;"),
    empty("", ""),
    equalSign("=", ""),
    plus("+", ""),
    minus("-", ""),
    // 星号
    asterisk("*", ""),
    // 斜杠
    sprit("/", ""),
    // 反斜杠
    backslash("\\", ""),
    underline("_", ""),
    underline_2("__", ""),
    colon(":", ""),
    semicolon(";", ""),
    // 回车
    carriageReturn("\n", ""),
    reLine("\r\n", ""),
    reLineOnly("\r", ""),
    question("?", ""),
    comma(",", ""),
    commaZh("，", ""),
    dot(".", ""),
    // 方括号
    brackets("[]", ""),
    bracketsLeft("[", ""),
    bracketsRight("]", ""),
    // 圆括号
    paren("()", ""),
    parenLeft("(", ""),
    parenRight(")", ""),
    // 大括号
    brace("{}", ""),
    braceLeft("{", ""),
    braceRight("}", ""),
    // 尖括号
    angleBrackets("<>", ""),
    angleBracketsLeft("<", "&lt;"),
    angleBracketsRight(">", "&gt;"),
    and("&", "&amp;"),
    or("|", ""),
    not("!", ""),
    quotesSingle("'", "&apos;"),
    sqlQuotes("`", ""),
    quotesDouble("\"", "&quot;"),
    percent("%", ""),
    poundSign("#", ""),
    CNYSign("￥", ""),
    dollarSign("$", ""),
    at("@", ""),
    tab("\t", "");

    public final String string;
    public final String htmlValue;

    SymbolEnum(String string, String htmlValue) {
        this.string = string;
        this.htmlValue = htmlValue;
    }

    public String more(int count) {
        StringBuilder value = new StringBuilder();
        for (int i = 0; i < count; i++) {
            value.append(this.string);
        }
        return value.toString();
    }

    @Override
    public String toString() {
        return this.string;
    }
}
